Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add full solenoid support on split keyboards #21583

Merged
merged 6 commits into from
Sep 25, 2023

Conversation

jacob-w-gable
Copy link
Contributor

Description

This provides a bugfix/enhancement that allows haptic feedback with solenoids to work on split keyboards. Support for haptic feedback on split keyboards was initially added in #19203 (aka #16233), but the feature was incomplete for solenoids (it didn't work at all). This PR fixes the solenoid problem, and also completes the feature by allowing the slave half to use the dwell time from the master half, meaning keycodes like QK_HAPTIC_DWELL_UP take immediate effect on both keyboard halves.

The key change is to call haptic_task() from keyboard_task() instead of quantum_task(), since solenoids require checking in the main keyboard loop in order to trigger, and quantum_task() is run only by the master half. haptic_init() was moved from quantum_init() to keyboard_init() for consistency.

Currently, all haptic_config data is sent to the slave half, but the solenoid driver doesn't use dwell from haptic_config even though it exists. It does use haptic_config for buzz, so there is some inconsistency there. This PR fixes that problem by using the dwell value from haptic_config, meaning the dwell is now synchronized.

I have tested this on a split keyboard, and it works to the best of my knowledge.

  • Both halves trigger at the same time
  • #define SOLENOID_DEFAULT_DWELL sets a default value for both halves
  • Haptic keycodes update the settings on both halves, (tested dwell time, buzz, and haptic toggle)
  • Removing #define SPLIT_HAPTIC_ENABLE disables the slave half but keeps the main half enabled

Types of Changes

  • Core
  • Bugfix
  • New feature
  • Enhancement/optimization
  • Keyboard (addition or update)
  • Keymap/layout/userspace (addition or update)
  • Documentation

Checklist

  • My code follows the code style of this project: C, Python
  • I have read the PR Checklist document and have made the appropriate changes.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • I have tested the changes and verified that they work and don't break anything (as well as I can manage).

@drashna drashna requested a review from a team July 24, 2023 18:50
@tzarc tzarc merged commit 99290b4 into qmk:develop Sep 25, 2023
grota added a commit to grota/qmk_keyboards that referenced this pull request Oct 15, 2023
mechlovin pushed a commit to mechlovin/qmk_firmware that referenced this pull request Oct 25, 2023
Co-authored-by: Jacob Gable <jacob.gable@statheros.tech>
christrotter pushed a commit to christrotter/qmk_firmware that referenced this pull request Nov 28, 2023
Co-authored-by: Jacob Gable <jacob.gable@statheros.tech>
zgagnon pushed a commit to zgagnon/qmk_firmware_waterfowl that referenced this pull request Dec 15, 2023
Co-authored-by: Jacob Gable <jacob.gable@statheros.tech>
future-figs pushed a commit to future-figs/qmk_firmware that referenced this pull request Dec 27, 2023
Co-authored-by: Jacob Gable <jacob.gable@statheros.tech>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants